package com.fqcar.fqdf.core;


import com.fqdf.framework.android.fragment.BaseFragment;

import butterknife.Unbinder;

/**
 * Created by 张枭 on 2017/7/31.
 * 需要使用到ButterKnife的Fragment继承这个类
 */
public abstract class BaseButterKnifeFragment extends BaseFragment {

    /**
     * 子类实现这个方法，返回ButterKnife.bind(this, itemView)的返回参数，用来释放ButterKnife资源
     */
    protected abstract Unbinder getBinder();

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        if (getBinder() != null) {
            getBinder().unbind();
        }
    }
}
